package com.cjh.lms.controller;

import java.io.IOException;

import org.apache.commons.io.IOUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.io.ResourceLoader;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class ForwardContraller {
	@Autowired
	private ResourceLoader resourceLoader;
	
	
	
	@RequestMapping("showpage")
	public String showpage(){
		return "bjui_index";
	}
	
	@RequestMapping("get_menu")
	@ResponseBody
	public String get_menu() throws IOException{		
		return IOUtils.toString(resourceLoader.getResource("WEB-INF/json/menu.json").getInputStream());	
	}
	@RequestMapping("json/storagemessage")
	@ResponseBody
	public String get_storagemessage() throws IOException{		
		return IOUtils.toString(resourceLoader.getResource("WEB-INF/json/storagemessage.json").getInputStream());	
	}
	
	
	@RequestMapping("dialog/{page}")
	public String dialog(@PathVariable String page){	
		return "Dialog/"+page;
	}
	
	@RequestMapping("forword/storage_message")
	public String storage_message(){	
		return "storage_message";
	}
	
	@RequestMapping("forword/storage_lock")
	public String storage_lock(){	
		return "storage_lock";
	}
	
	@RequestMapping("forword/storage_record")
	public String storage_record(){	
		return "storage_record";
	}
	@RequestMapping("forword/information_lock")
	public String information_lock(){	
		return "information_lock";
	}
	
	@RequestMapping("forword/information_repair")
	public String information_repair(){	
		return "information_repair";
	}
	
	@RequestMapping("forword/allocation_manage")
	public String allManage(){	
		return "allocation_manage";
	}
	@RequestMapping("forword/allocation_company")
	public String allocation_company(){	
		return "allocation_company";
	}
	@RequestMapping("forword/allocation_record")
	public String allocation_record(){	
		return "allocation_record";
	}
	
}

